3.199 \(\int \tan ^3(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=82 \[ \frac{b (2 a-b) \tan ^4(e+f x)}{4 f}+\frac{(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{b^2 \tan ^6(e+f x)}{6 f} \]

[Out]

((a - b)^2*Log[Cos[e + f*x]])/f + ((a - b)^2*Tan[e + f*x]^2)/(2*f) + ((2*a - b)*b*Tan[e + f*x]^4)/(4*f) + (b^2
*Tan[e + f*x]^6)/(6*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0947573, antiderivative size = 82, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 77} \[ \frac{b (2 a-b) \tan ^4(e+f x)}{4 f}+\frac{(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{b^2 \tan ^6(e+f x)}{6 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^3*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

((a - b)^2*Log[Cos[e + f*x]])/f + ((a - b)^2*Tan[e + f*x]^2)/(2*f) + ((2*a - b)*b*Tan[e + f*x]^4)/(4*f) + (b^2
*Tan[e + f*x]^6)/(6*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^3 \left (a+b x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x (a+b x)^2}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left ((a-b)^2+(2 a-b) b x+b^2 x^2-\frac{(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac{(2 a-b) b \tan ^4(e+f x)}{4 f}+\frac{b^2 \tan ^6(e+f x)}{6 f}\\ \end{align*}

Mathematica [A]  time = 0.270865, size = 72, normalized size = 0.88 \[ \frac{3 b (2 a-b) \tan ^4(e+f x)+6 (a-b)^2 \tan ^2(e+f x)+12 (a-b)^2 \log (\cos (e+f x))+2 b^2 \tan ^6(e+f x)}{12 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^3*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(12*(a - b)^2*Log[Cos[e + f*x]] + 6*(a - b)^2*Tan[e + f*x]^2 + 3*(2*a - b)*b*Tan[e + f*x]^4 + 2*b^2*Tan[e + f*
x]^6)/(12*f)

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 151, normalized size = 1.8 \begin{align*}{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{6}}{6\,f}}+{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{4}ab}{2\,f}}-{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{4\,f}}+{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}{a}^{2}}{2\,f}}-{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}ab}{f}}+{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){a}^{2}}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ab}{f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){b}^{2}}{2\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/6*b^2*tan(f*x+e)^6/f+1/2/f*tan(f*x+e)^4*a*b-1/4/f*b^2*tan(f*x+e)^4+1/2/f*tan(f*x+e)^2*a^2-1/f*tan(f*x+e)^2*a
*b+1/2*b^2*tan(f*x+e)^2/f-1/2/f*ln(1+tan(f*x+e)^2)*a^2+1/f*ln(1+tan(f*x+e)^2)*a*b-1/2/f*ln(1+tan(f*x+e)^2)*b^2

________________________________________________________________________________________

Maxima [A]  time = 1.17388, size = 171, normalized size = 2.09 \begin{align*} \frac{6 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac{6 \,{\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \sin \left (f x + e\right )^{4} - 3 \,{\left (4 \, a^{2} - 14 \, a b + 9 \, b^{2}\right )} \sin \left (f x + e\right )^{2} + 6 \, a^{2} - 18 \, a b + 11 \, b^{2}}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1}}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/12*(6*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2 - 1) - (6*(a^2 - 4*a*b + 3*b^2)*sin(f*x + e)^4 - 3*(4*a^2 - 14*
a*b + 9*b^2)*sin(f*x + e)^2 + 6*a^2 - 18*a*b + 11*b^2)/(sin(f*x + e)^6 - 3*sin(f*x + e)^4 + 3*sin(f*x + e)^2 -
 1))/f

________________________________________________________________________________________

Fricas [A]  time = 1.11725, size = 209, normalized size = 2.55 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right )^{6} + 3 \,{\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{4} + 6 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} + 6 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/12*(2*b^2*tan(f*x + e)^6 + 3*(2*a*b - b^2)*tan(f*x + e)^4 + 6*(a^2 - 2*a*b + b^2)*tan(f*x + e)^2 + 6*(a^2 -
2*a*b + b^2)*log(1/(tan(f*x + e)^2 + 1)))/f

________________________________________________________________________________________

Sympy [A]  time = 0.991556, size = 160, normalized size = 1.95 \begin{align*} \begin{cases} - \frac{a^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac{a b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac{a b \tan ^{4}{\left (e + f x \right )}}{2 f} - \frac{a b \tan ^{2}{\left (e + f x \right )}}{f} - \frac{b^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{b^{2} \tan ^{6}{\left (e + f x \right )}}{6 f} - \frac{b^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} + \frac{b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \tan ^{3}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**3*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((-a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**2/(2*f) + a*b*log(tan(e + f*x)**2 + 1)/f
+ a*b*tan(e + f*x)**4/(2*f) - a*b*tan(e + f*x)**2/f - b**2*log(tan(e + f*x)**2 + 1)/(2*f) + b**2*tan(e + f*x)*
*6/(6*f) - b**2*tan(e + f*x)**4/(4*f) + b**2*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(a + b*tan(e)**2)**2*tan(e)*
*3, True))

________________________________________________________________________________________

Giac [B]  time = 7.75961, size = 3510, normalized size = 42.8 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/12*(6*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan(e)^6 - 12*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)
^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan(e)^6 + 6*b^2*log(4*(tan(
e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) +
1))*tan(f*x)^6*tan(e)^6 + 6*a^2*tan(f*x)^6*tan(e)^6 - 18*a*b*tan(f*x)^6*tan(e)^6 + 11*b^2*tan(f*x)^6*tan(e)^6
- 36*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 -
2*tan(f*x)*tan(e) + 1))*tan(f*x)^5*tan(e)^5 + 72*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*
tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^5*tan(e)^5 - 36*b^2*log(4*(tan(e)
^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)
)*tan(f*x)^5*tan(e)^5 + 6*a^2*tan(f*x)^6*tan(e)^4 - 12*a*b*tan(f*x)^6*tan(e)^4 + 6*b^2*tan(f*x)^6*tan(e)^4 - 2
4*a^2*tan(f*x)^5*tan(e)^5 + 84*a*b*tan(f*x)^5*tan(e)^5 - 54*b^2*tan(f*x)^5*tan(e)^5 + 6*a^2*tan(f*x)^4*tan(e)^
6 - 12*a*b*tan(f*x)^4*tan(e)^6 + 6*b^2*tan(f*x)^4*tan(e)^6 + 90*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2
- 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 - 180*a
*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(
f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 + 90*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e)
 + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 + 6*a*b*tan(f*x)^6*tan(e)^2
- 3*b^2*tan(f*x)^6*tan(e)^2 - 24*a^2*tan(f*x)^5*tan(e)^3 + 72*a*b*tan(f*x)^5*tan(e)^3 - 36*b^2*tan(f*x)^5*tan(
e)^3 + 42*a^2*tan(f*x)^4*tan(e)^4 - 138*a*b*tan(f*x)^4*tan(e)^4 + 99*b^2*tan(f*x)^4*tan(e)^4 - 24*a^2*tan(f*x)
^3*tan(e)^5 + 72*a*b*tan(f*x)^3*tan(e)^5 - 36*b^2*tan(f*x)^3*tan(e)^5 + 6*a*b*tan(f*x)^2*tan(e)^6 - 3*b^2*tan(
f*x)^2*tan(e)^6 - 120*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^
2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 + 240*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)
^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 12
0*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*t
an(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 + 2*b^2*tan(f*x)^6 - 12*a*b*tan(f*x)^5*tan(e) + 18*b^2*tan(f*x)^5*tan
(e) + 36*a^2*tan(f*x)^4*tan(e)^2 - 120*a*b*tan(f*x)^4*tan(e)^2 + 90*b^2*tan(f*x)^4*tan(e)^2 - 48*a^2*tan(f*x)^
3*tan(e)^3 + 144*a*b*tan(f*x)^3*tan(e)^3 - 72*b^2*tan(f*x)^3*tan(e)^3 + 36*a^2*tan(f*x)^2*tan(e)^4 - 120*a*b*t
an(f*x)^2*tan(e)^4 + 90*b^2*tan(f*x)^2*tan(e)^4 - 12*a*b*tan(f*x)*tan(e)^5 + 18*b^2*tan(f*x)*tan(e)^5 + 2*b^2*
tan(e)^6 + 90*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(
f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 180*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*t
an(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 + 90*b^2*log
(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*t
an(e) + 1))*tan(f*x)^2*tan(e)^2 + 6*a*b*tan(f*x)^4 - 3*b^2*tan(f*x)^4 - 24*a^2*tan(f*x)^3*tan(e) + 72*a*b*tan(
f*x)^3*tan(e) - 36*b^2*tan(f*x)^3*tan(e) + 42*a^2*tan(f*x)^2*tan(e)^2 - 138*a*b*tan(f*x)^2*tan(e)^2 + 99*b^2*t
an(f*x)^2*tan(e)^2 - 24*a^2*tan(f*x)*tan(e)^3 + 72*a*b*tan(f*x)*tan(e)^3 - 36*b^2*tan(f*x)*tan(e)^3 + 6*a*b*ta
n(e)^4 - 3*b^2*tan(e)^4 - 36*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*
tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 72*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(
e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 36*b
^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(
f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 6*a^2*tan(f*x)^2 - 12*a*b*tan(f*x)^2 + 6*b^2*tan(f*x)^2 - 24*a^2*tan(f*x)*
tan(e) + 84*a*b*tan(f*x)*tan(e) - 54*b^2*tan(f*x)*tan(e) + 6*a^2*tan(e)^2 - 12*a*b*tan(e)^2 + 6*b^2*tan(e)^2 +
 6*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*
tan(f*x)*tan(e) + 1)) - 12*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*ta
n(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 6*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3
*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 6*a^2 - 18*a*b + 11*b^2)/(f*tan(f*x)^6*
tan(e)^6 - 6*f*tan(f*x)^5*tan(e)^5 + 15*f*tan(f*x)^4*tan(e)^4 - 20*f*tan(f*x)^3*tan(e)^3 + 15*f*tan(f*x)^2*tan
(e)^2 - 6*f*tan(f*x)*tan(e) + f)